//Nathan Popham, Ryan Wachowiak
//


uniform float blurSize;
uniform float blurDir;
uniform sampler2D myTexture;

void main()
{
    //int numSamples = 8;
    vec4 color = vec4(0.0);

    //for(int i = -numSamples/2; i <= numSamples/2; i++)
    //{
    //    color += texture2D(myTexture, vec2(gl_TexCoord[0].s + i*blurSize, glTexCoord[0].t));
    //}

   float blurX = blurSize * blurDir;
   float blurY = blurSize * (1.0 - blurDir);

   color += texture2D(myTexture, vec2(gl_TexCoord[0].s - 4.0*blurX, gl_TexCoord[0].t - 4.0*blurY))* 0.05;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s - 3.0*blurX, gl_TexCoord[0].t - 3.0*blurY)) * 0.09;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s - 2.0*blurX, gl_TexCoord[0].t - 2.0*blurY)) * 0.12;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s - 1.0*blurX, gl_TexCoord[0].t - 1.0*blurY)) * 0.15;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t)) * .16;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s + 1.0*blurX, gl_TexCoord[0].t + 1.0*blurY)) * 0.15;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s + 2.0*blurX, gl_TexCoord[0].t + 2.0*blurY)) * 0.12;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s + 3.0*blurX, gl_TexCoord[0].t + 3.0*blurY)) * 0.09;
   color += texture2D(myTexture, vec2(gl_TexCoord[0].s + 4.0*blurX, gl_TexCoord[0].t + 4.0*blurY)) * 0.05;

   gl_FragColor = color;
} 
